import { Button } from 'antd';
import { Link } from 'react-router-dom';
// import React from 'react';
import request from '@/http';
import { history } from '@/.umi/core/history';
import React, { useState, useEffect } from 'react';

const details = () => {
  // const [data, setData] = React.useState();
  let [data, setData] = useState<any>({
    id: 1,
    wc_tattachment: '1',
    wc_remark: '1',
    wc_score: '1',
  });
  //显示
  const loadData = async () => {
    console.log(history?.location?.query?.workId);
    const result: any = await request.post('/homework_manage/ask/st_PiFu', {
      workId: history?.location?.query?.workId,
    });
    // console.log(result.data);
    // setData(result.data);
    data = result.data;
    console.log(data);
  };
  React.useEffect(() => {
    loadData();
  }, []);
  return (
    <div style={{ marginTop: 200, marginLeft: 500, fontSize: 20 }}>
      <div style={{ marginTop: 20 }}>得分：{data.wc_score}</div>
      <span></span>
      <div style={{ marginTop: 20 }}>附件：{data.wc_tattachment}</div>
      <a></a>
      <div style={{ marginTop: 20 }}>评语：{data.wc_remark}</div>
      <span></span>
      <Link to="/Student/TaskManagement/Reply">
        <Button>返回</Button>
      </Link>
    </div>
  );
};
export default details;
